let { $, table, layer, form } = layui;
export default class Delete {
    constructor(data,obj) {
        this.handle(data,obj);
    }
    handle(data,obj) {
        layer.confirm('真的要删掉吗?', function (index) {
            $.ajax({
                type: "delete",
                url: "/users/" + data._id,
                success: function (res) {
                    if (res.data.acknowledged) {
                        layer.msg("删除成功");
                        obj.del(); //删除对应行（tr）的DOM结构，并更新缓存
                        layer.close(index)
                    }
                }
            })
            //向服务端发送删除指令
        });
    };
}